package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.SysCity;
import com.ruoyi.system.domain.SysProvince;
import com.ruoyi.system.service.SysCityService;
import com.ruoyi.system.service.SysProvinceService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 区域信息Controller
 * 省市
 * @author maple
 */
@Controller
@RequestMapping("/system/area")
public class SysAreaController  extends BaseController {
    private String prefix = "system/area";
    @Autowired
    private SysCityService cityService;


    @RequiresPermissions("system:area:view")
    @GetMapping()
    public String student()
    {
        return prefix + "/area";
    }

    @RequiresPermissions("system:area:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(String pname,String cname)
    {
        startPage();
        List<SysCity> list = cityService.queryList(pname,cname);
        return getDataTable(list);
    }
}
